package com.zp.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.xml.bind.annotation.XmlRootElement;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

/**
 * create answer item information entity with properties
 * 
 * @version 1.0
 * 
 * @since 1.0
 * 
 * @author chenlijun08@gmail.com
 * 
 * @date 2014/2/22
 * 
 */
@XmlRootElement
@Entity
@Table(catalog = "zzyyp", name = "tb_answer_item")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class AnswerItem implements Serializable {

	private static final long serialVersionUID = 1L;
	private String id;
	private String questionId;
	// answer code like A,B,C,D
	private String answerCode;
	// answer value
	private String value;

	@Id
	@GenericGenerator(name = "generator", strategy = "uuid")
	@GeneratedValue(generator = "generator")
	@Column(length = 32, nullable = false, name = "answer_item_id", unique = true)
	public String getId() {
		return id;
	}

	public void setId(String userId) {
		this.id = userId;
	}

	@Column(length = 32, nullable = false, name = "answer_question_id")
	public String getQuestionId() {
		return questionId;
	}

	public void setQuestionId(String questionId) {
		this.questionId = questionId;
	}

	@Column(length = 1, nullable = false, name = "answer_code")
	public String getAnswerCode() {
		return answerCode;
	}

	public void setAnswerCode(String answerCode) {
		this.answerCode = answerCode;
	}

	@Column(length = 200, name = "answer_value")
	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

}
